﻿/// <reference path="../GeneratedArtifacts/viewModel.js" />
myapp.AddEditPerson.columns_postRender = function (element, contentItem) {

    // Display Initial Values
    var FirstName = contentItem.value.FirstName;
    var LastName = contentItem.value.LastName;

    var InitialValues = 'Initial Values:'
                            + ' FirstName = '
                            + FirstName
                            + ' LastName = '
                            + LastName;

    
    toastr.info(InitialValues);

    // Binding to only the FirstName property
    contentItem.dataBind("value.FirstName", function (newValue) {

        var newFirstName = newValue;

        var updatedFirstNameOnly = 'Updated FirstNameOnly: '
                                    + newFirstName;

        toastr.info(updatedFirstNameOnly);
    });

    // Binding to LastName isChanged property
    contentItem.dataBind("value.details.properties.LastName.isChanged", function (newValue) {

        var isChangedLastName = 'LastName.isChanged: '
                                    + newValue;

        toastr.info(isChangedLastName);
    });

};
myapp.AddEditPerson.created = function (screen) {
    // Write code here.

};